package com.ruoyi.system.controller;

import java.util.List;

import com.ruoyi.system.domain.Appointment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.system.domain.vo.AppointmentVo;
import com.ruoyi.system.service.IAppointmentService;

/**
 * 预约挂号Controller
 *
 * @author ruoyi
 * @date 2025-05-14
 */
@RestController
@RequestMapping("/appointment")
public class AppointmentController extends BaseController {
    @Autowired
    private IAppointmentService appointmentService;

    /**
     * 查询预约挂号列表
     */
    @GetMapping("/list")
    public TableDataInfo list(AppointmentVo appointmentVo) {
        startPage();  // 开启分页
        List<AppointmentVo> list = appointmentService.selectAppointmentList(appointmentVo);
        return getDataTable(list);
    }

    /**
     * 根据ID查询预约挂号详情
     */
    @GetMapping("/{id}")
    public Appointment getInfo(@PathVariable("id") Long id) {
        return appointmentService.selectAppointmentById(id);
    }

}
